package com.douqu.game;

import com.douqu.game.core.factory.LoadFactory;
import com.douqu.game.core.util.LogUtils;
import com.douqu.game.fileManager.FileManager;
import com.douqu.game.mergeManager.mergeUtils.MergeMain;

import java.io.InputStream;
import java.util.Properties;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-01-29 19:31
 */
public class StartServer {

    public static void main(String[] args)
    {
        LoadFactory.loadPlatform();

        loadManager();

        new MainFrame();
    }


    public static void loadManager()
    {
        String managerConfig = "manager.properties";

        LogUtils.info("【Load Config Start FileName=" + managerConfig + "】");

        Properties properties = new Properties();
        InputStream input =  null;
        try {
            input = LoadFactory.getInputStream(managerConfig);
            properties.load(input);

            FileManager.EXCEL_IN = properties.get("excel_in").toString().trim();
            FileManager.EXCEL_OUT = properties.get("excel_out").toString().trim();
            FileManager.ENCODE_OUT = properties.get("encode_out").toString().trim();
            FileManager.UPLOAD_IN = properties.get("upload_in").toString().trim();
            MergeMain.MERGE_URL = properties.get("merge_url").toString().trim();

            LogUtils.info("Excel输入路径----------【" + FileManager.EXCEL_IN + "】");
            LogUtils.info("Excel输出路径----------【" + FileManager.EXCEL_OUT + "】");
            LogUtils.info("加密输出路径-----------【" + FileManager.ENCODE_OUT + "】");
            LogUtils.info("上传目录---------------【" + FileManager.UPLOAD_IN + "】");
            LogUtils.info("合服URL----------------【" + MergeMain.MERGE_URL + "】");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
